package com.qf.deviceprovider8002.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * @author q
 * @version V1.0
 * @date 2022/01/17
 **/
@RestController
@RequestMapping("/pro/device")
public class DevProController {

    @Value("${server.port}")
    private String port;

    @GetMapping("/hello")
    public String hello(){
        return "DevPro -> " + port;
    }

    @GetMapping("/get/resttemplate")
    public String getRestTemplate(Integer id, String name){
        return "get getRestTemplate" + id + " " + name + " " + port;
    }

    @PostMapping("/post/resttemplate")
    public String postRestTemplate(Integer id, String name, @CookieValue(required = false, name = "token") String token){
        return "post postRestTemplate" + id + " " + name + " " + port + "---token:" + token;
    }

}
